public class Demo41 {
    private static  int total = 0;
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                int sum = 0;
                for (int i = 1; i <= 100; i++) {
                    sum += 0;
                }
                total = sum;
            }
        };
        Thread t =new Thread(runnable);
        t.start();
        t.join();
        System.out.println(total);
    }
}
